package com.dyg.service.Impl;

import java.util.List;
import com.dyg.dao.RoleresourceMapper;
import com.dyg.model.RoleResource;
import com.dyg.service.RoleresourceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class RoleresourceServiceImpl implements RoleresourceService {

	@Autowired
	private RoleresourceMapper roleresourceMapper;

	@Override
	public void insertRoleresource(RoleResource RoleResource)	{
		this.roleresourceMapper.insertRoleresource(RoleResource);
	}

	@Override
	public void deleteRoleresourceById(String roleresourceId)	{
		this.roleresourceMapper.deleteRoleresourceById(roleresourceId);
	}

	@Override
	public void updateRoleresource(RoleResource RoleResource)	{
		this.roleresourceMapper.updateRoleresource(RoleResource);
	}

	@Override
	public RoleResource findRoleresourceById(String roleresourceId)	{
		return this.roleresourceMapper.findRoleresourceById(roleresourceId);
	}

	@Override
	public List<RoleResource> findRoleresourceList()	{
		return this.roleresourceMapper.findRoleresourceList();
	}
	
	/**
     * 根据角色 id 和权限 id 删除一条用户权限关联数据
     * @param roleId
     * @param resId
     */
	@Override
	public void deleteRoleResource(Integer roleId, Integer resourceId) {
		this.roleresourceMapper.deleteRoleResource(roleId, resourceId);
	}

	@Override
	public RoleResource addRoleResource(RoleResource resource) {
		roleresourceMapper.insertRoleresource(resource);
		return resource;
	}


}
